import 'dart:convert';
// 书籍评论的消息
import 'package:quiver/time.dart';
class BookInfoComment {
  int id;
  int user_info_id;
  String cover;
  String content;
  DateTime publishTime;
  int scanTimes;
  String link;
  String userName;
  int bookInfoId;

  BookInfoComment(){

  }

 static  List<BookInfoComment>fromJson(dynamic data){

    List<BookInfoComment> comments = [];
    data.forEach((o) {
      BookInfoComment cm = BookInfoComment();
      cm.publishTime = DateTime.parse(o["publish_time"]);
      cm.userName = o["username"];
     // print("username ${o['username']}");
      cm.link = o["link"];
      cm.cover = o["cover"];
      cm.content = o["content"];
      cm.user_info_id = o["user_info_id"];
      cm.id=o["id"];
      cm.scanTimes = o["scan_times"];
      
      comments.add(cm);
    });
    return comments;

  }

  @override
  String toString() {
    return 'BookInfoComment{id: $id, user_info_id: $user_info_id, cover: $cover, content: $content, publishTime: $publishTime, scanTimes: $scanTimes, link: $link, userName: $userName, bookInfoId: $bookInfoId}';
  }


}